//
//  receivegiftgetlist.m
//  tcpoctest
//
//  Created by gump on 5/21/13.
//  Copyright (c) 2013 gump. All rights reserved.
//

#import "receivegiftgetlist.h"
#import "GiftListDataSource.h"
#import "giftlistDataInfo.h"

@implementation receivegiftgetlist

-(void)processreceive
{
    //返回 26char(1),7char(1)，
    //[分类ID char(1),礼物分类名称长度char(1),
    //礼物分类名称char(x),图片url长度char(1),图片urlchar(x)]
    
    [[DataControl shareControl].giftlistDS delAllList];
    
    [[DataControl shareControl].UICommendDS addUICommand:UC_GIFT_GETLIST];
    
    while (logicsb.mrestLength > 0) {
        
        giftlistDataInfo *ginfo = [[giftlistDataInfo alloc] init];
        
        ginfo.giftid = [logicsb ReadChar];
        ginfo.name = [logicsb ReadUnencodeString];
        ginfo.url = [logicsb ReadUnencodeString];
        
        [[DataControl shareControl].giftlistDS AddGiftList:ginfo.giftid withGiftInfo:ginfo];
        
    }
    
    [[DataControl shareControl].UICommendDS addUICommand:UC_REFRESHCURVIEW];
    
    [self ShowLog];
}

@end
